package cn.bdqn.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.bdqn.mapper.TitleMapper;
import cn.bdqn.pojo.Title;
import cn.bdqn.service.TitleService;

@Service("TitleService")
public class TitleServiceImpl implements TitleService{

	@Resource
	public TitleMapper titleMapper;
	
	  @Override
	    public List<Title> findTitle(String titleName, Integer deptId, Integer isEnable, Integer currentPageNo, Integer pageSize) {
	        currentPageNo = (currentPageNo-1)*pageSize;
	        List<Title> titleList = titleMapper.findTitle(titleName,deptId,isEnable,currentPageNo,pageSize);
	        return titleList;
	    }

	    @Override
	    public int count(String titleName, Integer deptId, Integer isEnable) {
	        int count = titleMapper.count(titleName,deptId,isEnable);
	        return count;
	    }

	    @Override
	    public int addTitle(Title title) {
	        int flag = titleMapper.addTitle(title);
	        return flag;
	    }

	    @Override
	    public Title getTitle(Integer titleId) {
	        Title title = titleMapper.getTitle(titleId);
	        return title;
	    }

	    @Override
	    public int modifyTitle(Title title) {
	        int flag = titleMapper.modifyTitle(title);
	        return flag;
	    }

	    @Override
	    public int delTitle(Integer titleId) {
	        int flag = titleMapper.delTitle(titleId);
	        return flag;
	    }
	

}
